import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    redirect: { name: 'home' },
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/Home.vue'),
    meta: {
      navShow: true,
    },
  },
  {
    path: '/CommodityDetails',
    name: 'CommodityDetails',
    component: () => import('@/views/CommodityDetails.vue'),
    meta: {
      navShow: false,
    },
  },
  {
    path: '/find',
    name: 'find',
    component: () => import('@/views/Find.vue'),
    meta: {
      navShow: true,
    },
  },
  {
    path: '/mine',
    name: 'mine',
    component: () => import('@/views/Mine.vue'),
    meta: {
      navShow: true,
    },
  },
  {
    path: '/order',
    name: 'order',
    component: () => import('@/views/Order.vue'),
    meta: {
      navShow: true,
    },
  },
  {
    path: '/ShoppingCart',
    name: 'ShoppingCart',
    component: () => import('@/views/ShoppingCart.vue'),
    meta: {
      navShow: true,
    },
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login.vue'),
    meta: {
      navShow: false,
    },
  },
];

const router = new VueRouter({
  routes,
});

export default router;
